package mrh.niubi.librarysystem.service.impl;

import mrh.niubi.librarysystem.mapper.UserMapper;
import mrh.niubi.librarysystem.pojo.UserBean;
import mrh.niubi.librarysystem.service.UserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;


@Service
public class UserServiceImpl implements UserService {

    @Resource
    private UserMapper userMapper;

    @Override
    public UserBean findById(String id) {
        return userMapper.selectById(id);
    }

    @Override
    public int insertUser(UserBean newuser){
        return userMapper.insert(newuser);
    }

    public int delUserByUsername(String username){
        return userMapper.deleteById(username);
    }

    @Override
    public int editUser(UserBean user) {
        return userMapper.updateById(user);
    }

}
